package hud;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;

public class Toolbar {
    public static HBox create() {
        HBox hbox = new HBox();
        hbox.setPadding(new Insets(2, 2, 2, 2));
        hbox.setSpacing(3);

        Button buttonCurrent = new Button();
        Image image = new Image("database.png");
        ImageView imageView = new ImageView(image);
        buttonCurrent.setGraphic(imageView);
        buttonCurrent.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                ServerListDialog.instance().showAndWait();
            }
        });
        buttonCurrent.setPrefSize(40, 30);

        Button buttonProjected = new Button();
        image = new Image("folder.png");
        imageView = new ImageView(image);
        buttonProjected.setGraphic(imageView);
        buttonProjected.setPrefSize(40, 30);
        hbox.getChildren().addAll(buttonCurrent, buttonProjected);

        return hbox;
    }
}